home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
3863
/
3863.xpi
/
samples
/
Macros
/
Demo-Loop-Csv-2-Web.iim
< prev
next >
Wrap
Text File
|
2010-01-25
|
2KB
|
34 lines
VERSION BUILD=3700331
'Uses a Windows script to submit several datasets to a website, e. g. for filling an online database
TAB T=1
TAB CLOSEALLOTHERS
' Specify input file (if !COL variables are used, IIM automatically assume a CSV format of the input file
'CSV = Comma Separated Values in each line of the file
CMDLINE !DATASOURCE Address.csv
'Number of columns in the CSV file. This must be accurate!
SET !DATASOURCE_COLUMNS 8
'Start at line 2 to skip the header in the file
SET !LOOP 2
'Increase the current position in the file with each loop
SET !DATASOURCE_LINE {{!LOOP}}
' Fill web form
URL GOTO=http://www.iopus.com/imacros/demo/v5/f2/automatic-data-entry.asp
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:WebDataEntry ATTR=NAME:FNAME CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:WebDataEntry ATTR=NAME:LNAME CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:WebDataEntry ATTR=NAME:ADDRESS CONTENT={{!COL3}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:WebDataEntry ATTR=NAME:CITY CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:WebDataEntry ATTR=NAME:ZIP CONTENT={{!COL5}}
'
'Note * is used to ignore leading and trailing blanks that could be in the input data
'
'The precent (%) symbol is used to select the stateid by VALUE as defined in the website select statement and not by its index.
TAG POS=1 TYPE=SELECT FORM=NAME:WebDataEntry ATTR=NAME:STATEID CONTENT=$*{{!COL6}}*
'
'The string ($) symbol is used to select the country by TEXT, not by its index.
'Index would be the position of an entry in the combo box list, e. g. 161 for United States
TAG POS=1 TYPE=SELECT FORM=NAME:WebDataEntry ATTR=NAME:COUNTRYID CONTENT=$*{{!COL7}}*
'
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:WebDataEntry ATTR=NAME:EMAIL CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:WebDataEntry ATTR=NAME:SendButton&&VALUE:Click<SP>to<SP>submit<SP>data
TAG POS=1 TYPE=A ATTR=TXT:Back